# @summary A short summary of the purpose of this class
#
# A description of what this class does
#
# @example
#   include yumlocal::repos_alma
class yumlocal::repos_alma inherits yumlocal {
case $operatingsystem {
/AlmaLinux|almalinux/:{
  yumrepo {"alma-baseos":
    baseurl  => "http://${mirrorserver}/yum/almalinux/${operatingsystemrelease}/BaseOS/\$basearch/os/",
    descr    => 'AlmaLinux $releasever - BaseOS',
    enabled  => 1,
    gpgcheck => 0,
    priority => 20,
    before   => Yumrepo['site']
  }
  yumrepo {"alma-appstream":
    baseurl  => "http://${mirrorserver}/yum/almalinux/${operatingsystemrelease}/AppStream/\$basearch/os/",
    descr    => 'AlmaLinux $releasever - AppStream',
    enabled  => 1,
    gpgcheck => 0,
    priority => 20,
    before   => Yumrepo['site']
  }
  yumrepo {"alma-extras":
    baseurl  => "http://${mirrorserver}/yum/almalinux/${operatingsystemrelease}/extras/\$basearch/os/",
    descr    => 'AlmaLinux $releasever - Extras',
    enabled  => 1,
    gpgcheck => 0,
    priority => 20,
    before   => Yumrepo['site']
  }
  if $operatingsystemmajrelease >= '9' {
  yumrepo {"alma-crb":
    baseurl  => "http://${mirrorserver}/yum/almalinux/${operatingsystemrelease}/CRB/\$basearch/os/",
    descr    => 'AlmaLinux $releasever - CRB',
    enabled  => 1,
    gpgcheck => 0,
    priority => 20,
    before   => Yumrepo['site']
  }
  }
  else {
    yumrepo {"alma-powertools":
    baseurl  => "http://${mirrorserver}/yum/almalinux/${operatingsystemrelease}/PowerTools/\$basearch/os/",
    descr    => 'AlmaLinux $releasever - PowerTools',
    enabled  => 1,
    gpgcheck => 0,
    priority => 20,
    before   => Yumrepo['site']
  }
  }
  if $epelgrid {
    yumrepo { "epel":
      baseurl => "http://${mirrorserver}/yum/epel_grid/${operatingsystemmajrelease}/Everything/\$basearch",
      descr => "epel",
      metalink => absent,
      enabled => 1,
      gpgcheck => 0,
      priority => 40,
      before   => Yumrepo['site']
    }
  } elsif $epelyum{
    yumrepo { "epel":
      baseurl => "http://${mirrorserver}/yum/epel/${operatingsystemmajrelease}/Everything/\$basearch",
      descr => "epel",
      metalink => absent,
      enabled => 1,
      gpgcheck => 0,
      priority => 40,
      before   => Yumrepo['site']
  }
  }  else {
    yumrepo { "epel":
      baseurl => "http://${mirrorserver}/epel/${operatingsystemmajrelease}/Everything/\$basearch",
      descr => "epel",
      metalink => absent,
      enabled => 1,
      gpgcheck => 0,
      priority => 40,
      before   => Yumrepo['site']
    }
  }
  } #Alma


}
